package com.yuhanginfo.modules.sys.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yuhanginfo.common.persistence.Page;
import com.yuhanginfo.common.service.CrudService;
import com.yuhanginfo.modules.sys.dao.YongUserDao;
import com.yuhanginfo.modules.sys.entity.YongUser;


/**
 * 门店管理Service
 * @author yangs
 * @version 2017-09-13
 */
@Service
@Transactional(readOnly = true)
public class YongUserService extends CrudService<YongUserDao, YongUser> {
    @Autowired
    private YongUserDao yongUserDao;
	
	
	@Transactional(readOnly = false)
	public void save(YongUser user) {
		super.save(user);
	}
	
	@Transactional(readOnly = false)
	public void delete(YongUser user) {
		super.delete(user);
	}

	public Page<YongUser> selectVip(Page<YongUser> page, YongUser user) {
		user.setPage(page);
		page.setList(yongUserDao.selectVip(user));
		return page;
	}
	
	public Page<YongUser> selectCommonUser(Page<YongUser> page, YongUser user) {
		user.setPage(page);
		page.setList(yongUserDao.selectCommonUser(user));
		return page;
	}
	
	public Page<YongUser> selectVipUser(Page<YongUser> page, YongUser user) {
		user.setPage(page);
		page.setList(yongUserDao.selectVipUser(user));
		return page;
	}
	
	public Page<YongUser> vipUserInfoList(Page<YongUser> page, YongUser user) {
		user.setPage(page);
		page.setList(yongUserDao.vipUserInfoList(user));
		return page;
	}
	
	public void companyAuditingPass(YongUser user) {
		yongUserDao.companyAuditingPass(user);
	}

	public List<YongUser> selectByStoreCode(String id) {
		
		return yongUserDao.selectByStoreCode(id);
	}

	public List<YongUser> selectByStoreCodes(String id) {
		
		return yongUserDao.selectByStoreCodes(id);
	}

	public List<YongUser> selectVipByStoreCode(YongUser user) {
		
		return yongUserDao.selectVipByStoreCode(user);
	}

	public YongUser selectById(String userId) {
		
		return yongUserDao.selectById(userId);
	}
	
}